<template>
    <div class="loading">
        <div class="loader-inner ball-pulse">
            <div></div>
            <div></div>
            <div></div>
        </div>
        <div class="loading-frame">
            <p class="loading-word">加载中</p>
        </div>
    </div>
</template>
<script>
export default {
  name: "v-loading"
};
</script>

<style lang="stylus" rel="stylesheet/stylus">
.loading {
    font-family: 'Microsoft YaHei';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    width: 100%;
    height: 100%;

    .ball-pulse {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index 1001;
        margin-top -0.12rem;

        div {
            background-color: #FDF5E6
            width: .1rem;
            height: .1rem;
            border-radius: 100%;
            margin: 0.03rem;
            animation-fill-mode: both;
            display: inline-block;
        }

        div:nth-child(1) {
            animation: scale 0.75s -0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
        }

        div:nth-child(2) {
            animation: scale 0.75s -0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
        }

        div:nth-child(3) {
            animation: scale 0.75s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
        }
    }

    .loading-frame {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width 1.1rem
        height .85rem;
        background-color #222;
        z-index 1000;
        border-radius 0.04rem;
        opacity: 0.85;

        .loading-word {
            letter-spacing 0.01rem;
            text-align center;
            font-size .15rem;
            color #FDF5E6
            line-height .85rem;
            position relative;
            top .13rem;
        }
    }
}

@keyframes scale {
    0% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }

    45% {
        -webkit-transform: scale(0.1);
        transform: scale(0.1);
        opacity: 0.7;
    }

    80% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scale {
    0% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }

    45% {
        -webkit-transform: scale(0.1);
        transform: scale(0.1);
        opacity: 0.7;
    }

    80% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }
}
</style>